package com.example.yang.yixin.FragmentManager;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.HttpHeaderParser;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.example.yang.yixin.Adapter.EarlyAdapter;
import com.example.yang.yixin.Adapter.SignAdapter;
import com.example.yang.yixin.R;
import com.example.yang.yixin.Utils.Early_info;
import com.example.yang.yixin.Utils.Sign_info;
import com.example.yang.yixin.Views.AnnularView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

public class Fragment_Earlyorlate extends Fragment {
    Button button;
    private Float[] datas = new Float[3];
    AnnularView annularView;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view =inflater.inflate(R.layout.fragment_earlyorlate,container,false);
        annularView=view.findViewById(R.id.view_early);


        button=view.findViewById(R.id.qiehuan);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle=new Bundle();
                bundle.putString("bkpassword",getArguments().getString("bkpassword"));
                Fragment_detail fragment_detail=new Fragment_detail();
                fragment_detail.setArguments(bundle);
                 getFragmentManager().beginTransaction().replace(R.id.Fr_container,fragment_detail).commit();
            }
        });
        Initdata();
        return view;
    }

    private void Initdata() {
        float one=Float.valueOf(getArguments().getString("one"));
        float two=Float.valueOf(getArguments().getString("two"));
        float three=Float.valueOf(getArguments().getString("three"));
        datas[0]=one;
        datas[1]=two;
        datas[2]=three;
        annularView.setDatas(datas,true);
    }


}
